<script>
	function set_sinonim(isi, id){
		document.getElementById("sinonim").innerHTML = isi;
		document.forms["sinonim_edit"].sinonim.value = isi;
		document.forms["sinonim_edit"].id.value = id;
		$(".bs-edit-sinonim-modal-lg").modal('show');
	}
	
	function set_simbol(isi, id){
		document.forms["simbol_edit"].simbol.value = isi;
		document.forms["simbol_edit"].id.value = id;
		$(".bs-edit-simbol-modal-sm").modal('show');
	}
	
	function set_filter(isi, id){
		document.forms["filter_edit"].filter.value = isi;
		document.forms["filter_edit"].id.value = id;
		$(".bs-edit-filter-modal-sm").modal('show');
	}
</script>
<div id="page-wrapper">
	<div class="row">
		<div class="col-lg-12">
			<h1><i class="glyphicon glyphicon-font"></i> Kata <small>(Kata-kata yang digunakan untuk menyaring maupun persamaan)</small></h1>
			<ol class="breadcrumb">
				<li><a href="<?php echo base_url(); ?>admin"><i class="glyphicon glyphicon-home"></i> Dashboard</a></li>
				<li class="active"><i class="glyphicon glyphicon-font"></i> Kata</li>
			</ol>
		</div>
	</div><!-- /.row -->

	<div class="row">
		<div class="col-lg-6">
			<h2>Daftar Kata Penyaring <a  role="button" data-toggle="modal" data-target=".bs-baru-filter-modal-sm" class="btn btn-success btn-sm"><i class="glyphicon glyphicon-plus"></i> Add a new</a></h2>
			<div class="table-responsive">
			<table class="table table-bordered table-hover table-striped tablesorter">
				<thead>
                  <tr>
                    <th>No</th>
                    <th>Kata <i class="glyphicon glyphicon-sort"></i></th>
                    <th width="155px">Actions</th>
                  </tr>
				</thead>
				<tbody>
				<?php foreach($data_filter as $row){ ?>
				  <tr>
                    <td><?php echo$no_filter; ?></td>
                    <td><?php echo$row['kata']; ?></td>
                    <td>
						<a class="btn btn-info btn-sm" data-toggle="modal" onclick="set_filter('<?php echo$row['kata']; ?>','<?php echo$row['id']; ?>')"><i class="glyphicon glyphicon-pencil"></i> Edit</a>  
						<a href="<?php echo site_url('admin'); ?>/kata/filter/delete/<?php echo$row['id']; ?>" class="btn btn-danger btn-sm"><i class="glyphicon glyphicon-trash"></i> Delete</a>
					</td>
                  </tr>
				<?php $no_filter++; } ?>
				</tbody>
			</table>
			</div>
		</div>
	
		<div class="col-lg-6">
			<h2>Daftar Simbol <a  role="button" data-toggle="modal" data-target=".bs-baru-simbol-modal-sm" class="btn btn-success btn-sm"><i class="glyphicon glyphicon-plus"></i> Add a new</a></h2>
			<div class="table-responsive">
			<table class="table table-bordered table-hover table-striped tablesorter">
				<thead>
                  <tr>
                   <th>No</th>
                    <th>Simbol <i class="glyphicon glyphicon-sort"></i></th>
                    <th width="155px">Actions</th>
                  </tr>
				</thead>
				<tbody>
				<?php foreach($data_filter as $row){ ?>
				  <tr>
                    <td><?php echo$no_filter; ?></td>
                    <td><?php echo$row['kata']; ?></td>
                    <td>
						<a class="btn btn-info btn-sm" data-toggle="modal" onclick="set_simbol('<?php echo$row['kata']; ?>','<?php echo$row['id']; ?>')"><i class="glyphicon glyphicon-pencil"></i> Edit</a>  
						<a href="<?php echo site_url('admin'); ?>/kata/simbol/delete/<?php echo$row['id']; ?>" class="btn btn-danger btn-sm"><i class="glyphicon glyphicon-trash"></i> Delete</a>
					</td>
                  </tr>
				<?php $no_filter++; } ?>
				</tbody>
			</table>
			</div>
		</div>
	</div><!-- /.row -->
	
	<div class="row">
		<div class="col-lg-12">
			<h2>Daftar Sinonim <a  role="button" data-toggle="modal" data-target=".bs-baru-sinonim-modal-lg" class="btn btn-success btn-sm"><i class="glyphicon glyphicon-plus"></i> Add a new</a></h2>
			<div class="table-responsive">
			<table class="table table-bordered table-hover table-striped tablesorter">
				<thead>
                  <tr>
                   <th>No</th>
                    <th>Kata <i class="glyphicon glyphicon-sort"></i></th>
                    <th width="155px">Actions</th>
                  </tr>
				</thead>
				<tbody>
				<?php foreach($data_sinonim as $row){ ?>
				  <tr>
                    <td><?php echo$no_sinonim; ?></td>
                    <td><?php echo$row['kata']; ?></td>
                    <td>
						<a class="btn btn-info btn-sm" data-toggle="modal" onclick="set_sinonim('<?php echo$row['kata']; ?>','<?php echo$row['id']; ?>')"><i class="glyphicon glyphicon-pencil"></i> Edit</a>  
						<a href="<?php echo site_url('admin'); ?>/kata/sinonim/delete/<?php echo$row['id']; ?>" class="btn btn-danger btn-sm">Delete</a>
					</td>
                  </tr>
				<?php $no_sinonim++; } ?>
				</tbody>
			</table>
			</div>
		</div>
	</div><!-- /.row -->
</div>

<!--baru filter-->
<div class="modal fade bs-baru-filter-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-sm">
    <div class="modal-content">
	<form action="<?php echo base_url(); ?>admin/kata/simpan_filter" method="post" name="filter">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
		<h3 class="modal-title" id="myModalLabel"><b>Tambah Kata Filter</b></h3>
      </div>
      <div class="modal-body">
		<div class="form-group">
			<label>Kata Filter</label>
			<input class="form-control" placeholder="Masukan Kata" name="id" id="id" type="hidden">
			<input class="form-control" placeholder="Masukan Kata" name="filter" id="filter">
		</div>
      </div>
      <div class="modal-footer">
        <button type="submit" class="btn btn-default" data-dismiss="modal"><i class="glyphicon glyphicon-floppy-remove"></i> Batal</button>
        <button type="submit" class="btn btn-warning" data-dismiss=".modal"><i class="glyphicon glyphicon-floppy-saved"></i> Simpan</button>
      </div>
    </form>
	</div>
  </div>
</div>

<!--baru simbol-->
<div class="modal fade bs-baru-simbol-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-sm">
    <div class="modal-content">
	<form action="<?php echo base_url(); ?>admin/kata/simpan_simbol" method="post" name="simbol">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
		<h3 class="modal-title" id="myModalLabel"><b>Tambah Simbol</b></h3>
      </div>
      <div class="modal-body">
		<div class="form-group">
			<label>Simbol</label>
			<input class="form-control" placeholder="Masukan Simbol" name="id" id="id" type="hidden">
			<input class="form-control" placeholder="Masukan Simbol" name="simbol" id="simbol">
		</div>
      </div>
      <div class="modal-footer">
        <button type="submit" class="btn btn-default" data-dismiss="modal"><i class="glyphicon glyphicon-floppy-remove"></i> Batal</button>
        <button type="submit" class="btn btn-warning" data-dismiss=".modal"><i class="glyphicon glyphicon-floppy-saved"></i> Simpan</button>
      </div>
    </form>
	</div>
  </div>
</div>

<!--baru sinonim-->
<div class="modal fade bs-baru-sinonim-modal-lg" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
	<form action="<?php echo base_url(); ?>admin/kata/simpan_sinonim" method="post" name="sinonim">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
		<h3 class="modal-title" id="myModalLabel"><b>Tambah Sinonim</b></h3>
      </div>
      <div class="modal-body">
		<div class="form-group">
			<label>Sinonim</label>
			<input class="form-control" placeholder="Masukan Sinonim" name="id" id="id" type="hidden">
			<i><span id="sinonim_isi"></span></i>
			<textarea style="width:865px; height:300px" class="form-control" name="sinonim" id="sinonim"></textarea>
		</div>
      </div>
      <div class="modal-footer">
        <button type="submit" class="btn btn-default" data-dismiss="modal"><i class="glyphicon glyphicon-floppy-remove"></i> Batal</button>
        <button type="submit" class="btn btn-warning" data-dismiss=".modal"><i class="glyphicon glyphicon-floppy-saved"></i> Simpan</button>
      </div>
    </form>
	</div>
  </div>
</div>


<!--edit filter-->
<div class="modal fade bs-edit-filter-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-sm">
    <div class="modal-content">
	<form action="<?php echo base_url(); ?>admin/kata/ubah_filter" method="post" name="filter_edit">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
		<h3 class="modal-title" id="myModalLabel"><b>Ubah Kata Filter</b></h3>
      </div>
      <div class="modal-body">
		<div class="form-group">
			<label>Kata Filter</label>
			<input class="form-control" placeholder="Masukan Kata" name="id" id="id" type="hidden">
			<input class="form-control" placeholder="Masukan Kata" name="filter" id="filter">
		</div>
      </div>
      <div class="modal-footer">
        <button type="submit" class="btn btn-default" data-dismiss="modal"><i class="glyphicon glyphicon-floppy-remove"></i> Batal</button>
        <button type="submit" class="btn btn-warning" data-dismiss=".modal"><i class="glyphicon glyphicon-floppy-save"></i> Simpan</button>
      </div>
    </form>
	</div>
  </div>
</div>

<!--edit simbol-->
<div class="modal fade bs-edit-simbol-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-sm">
    <div class="modal-content">
	<form action="<?php echo base_url(); ?>admin/kata/ubah_simbol" method="post" name="simbol_edit">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
		<h3 class="modal-title" id="myModalLabel"><b>Ubah Simbol</b></h3>
      </div>
      <div class="modal-body">
		<div class="form-group">
			<label>Simbol</label>
			<input class="form-control" placeholder="Masukan Simbol" name="id" id="id" type="hidden">
			<input class="form-control" placeholder="Masukan Simbol" name="simbol" id="simbol">
		</div>
      </div>
      <div class="modal-footer">
        <button type="submit" class="btn btn-default" data-dismiss="modal"><i class="glyphicon glyphicon-floppy-remove"></i> Batal</button>
        <button type="submit" class="btn btn-warning" data-dismiss=".modal"><i class="glyphicon glyphicon-floppy-saved"></i> Simpan</button>
      </div>
    </form>
	</div>
  </div>
</div>

<!--editsinonim-->
<div class="modal fade bs-edit-sinonim-modal-lg" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
	<form action="<?php echo base_url(); ?>admin/kata/ubah_sinonim" method="post" name="sinonim_edit">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
		<h3 class="modal-title" id="myModalLabel"><b>Ubah Sinonim</b></h3>
      </div>
      <div class="modal-body">
		<div class="form-group">
			<label>Sinonim</label>
			<input class="form-control" placeholder="Masukan Sinonim" name="id" id="id" type="hidden">
			<i><span id="sinonim"></span></i>
			<textarea style="width:865px; height:300px" class="form-control" name="sinonim" id="sinonim"></textarea>
		</div>
      </div>
      <div class="modal-footer">
        <button type="submit" class="btn btn-default" data-dismiss="modal"><i class="glyphicon glyphicon-floppy-remove"></i> Batal</button>
        <button type="submit" class="btn btn-warning" data-dismiss=".modal"><i class="glyphicon glyphicon-floppy-saved"></i> Simpan</button>
      </div>
    </form>
	</div>
  </div>
</div>